#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPreInstance,
LPSTR lpCmdLine, int nCmdShow)
{
	TCHAR sCommandLine[100];
	BOOL ret;
	DWORD dwExitCode;
	PROCESS_INFORMATION pi;
	STARTUPINFO si = {sizeof(si)} ;
	GetWindowsDirectory(sCommandLine, MAX_PATH);
	strcat(sCommandLine, "\\NotePad.exe");
	ret = CreateProcess(NULL, sCommandLine, NULL,NULL,FALSE, 0, NULL, NULL,
	&si, &pi);
	if(ret)
	{
		CloseHandle(pi.hThread);
		WaitForSingleObject(pi.hProcess, INFINITE);
		GetExitCodeProcess(pi.hProcess, &dwExitCode);
		CloseHandle(pi.hProcess);
	}
	return 0;
}
